home *** CD-ROM | disk | FTP | other *** search
/ GameStar 2005 October / Gamestar_77_2005-10_dvd.iso / Dema / betonsoldier_spdemo.exe / {app} / Shaders / mesh_Debug_Artefacts.fx < prev    next >
Encoding:
Text File  |  2005-05-05  |  2.9 KB  |  121 lines

  1. //------------------------------------------------------------------------------------------------------
  2. // mesh_debug_Artefacts.fx
  3. //
  4. // file type: Shader File
  5. // Usage        : line rendering
  6. // 
  7. //------------------------------------------------------------------------------------------------------
  8.  
  9. #include "shared.fx"
  10. #include "lighting.fx"
  11. #define FOG_DISABLE
  12. #include "fog.fx"
  13.  
  14. float4 Color;
  15. float  LineWidth;
  16.  
  17. //------------------------------------
  18. struct vertexInput {
  19.     float4 Position    : POSITION;
  20.     float3 Color    : TEXCOORD0;
  21. };
  22.  
  23. struct vertexOutput {
  24.     float4 Position : POSITION;
  25.     float4 Diffuse     : COLOR0;
  26.     FOG_OPTION_VERTEX_FIELD
  27. };
  28.  
  29. //------------------------------------
  30. vertexOutput VS_Debug_Line_Tranform(vertexInput input) 
  31. {
  32.     vertexOutput output;
  33.     output.Position = mul (input.Position,CameraProjection);
  34. //    output.Position.xyz = input.Position;
  35. //    output.Position.w = 1.0f;
  36.     output.Diffuse.xyz    = input.Color.xyz;
  37.     output.Diffuse.w    = 1.0f;
  38.     
  39.     // fog computation
  40.     FOG_OPTION_COMPUTE(output, output.Position);
  41.     
  42.     return output;
  43. }
  44.  
  45. //-----------------------------------
  46. technique LineRendering
  47. <
  48.     int Priority = 10;
  49.     int NeedSorting = 1;
  50.     int TechniqueIndex = 0;
  51.     int DeviceType = HWSHADER_ONLY;
  52.     int LightingType = INTEGRATED_LIGHTING;
  53.     string RenderingType = "Standard";
  54. >
  55. {
  56.     pass pass1
  57.     {
  58.         CullMode            = NONE; 
  59.         ZEnable                = false; 
  60.         //ZFunc                = LESSEQUAL; 
  61.         //ZWriteEnable        = true; 
  62.         AlphaBlendEnable    = false;
  63.         FOG_OPTION_PARAMETERS;
  64.         
  65.         
  66.         VertexShader = compile vs_1_1 VS_Debug_Line_Tranform();
  67.  
  68.         // Just use the color
  69.         PixelShader     = 
  70.         asm
  71.         {
  72.             ps_1_1
  73.         
  74.             mov r0, v0        
  75.         };
  76.     }
  77. }
  78.  
  79.  
  80. technique LineRenderingWithZ
  81. <
  82.     int Priority = 10;
  83.     int NeedSorting = 1;
  84.     int TechniqueIndex = 1;
  85.     int DeviceType = HWSHADER_ONLY;
  86.     int LightingType = INTEGRATED_LIGHTING;
  87.     string RenderingType = "Standard";
  88. >
  89. {
  90.     pass pass1
  91.     {
  92.         CullMode            = NONE; 
  93.         ZEnable                = true; 
  94.         ZFunc                = LESSEQUAL; 
  95.         ZWriteEnable        = false; 
  96.         AlphaBlendEnable    = false;
  97.         FOG_OPTION_PARAMETERS;
  98.                 
  99.         VertexShader = compile vs_1_1 VS_Debug_Line_Tranform();
  100.  
  101.         // Just use the color    
  102.         PixelShader     = 
  103.         asm
  104.         {
  105.             ps_1_1
  106.         
  107.             mov r0, v0        
  108.         };
  109.     }
  110. }
  111.  
  112. //------------------------------------------------------------------------------------------------------
  113. //------------------------------------------------------------------------------------------------------
  114. //------------------------------------------------------------------------------------------------------
  115.  
  116. #include "mesh_shadow.fx"
  117. #include "mesh_shadow_projector.fx"
  118.  
  119. //------------------------------------------------------------------------------------------------------
  120. //------------------------------------------------------------------------------------------------------
  121. //------------------------------------------------------------------------------------------------------